/**
 * @author caif
 * @fileoverview uploadView
 * @extends file viewer
 */
 App.Views.fileView = App.Views.itemView.extend(
 {  
     template : tpl.file,
     
     events: {
		"keyup .edit"         : "updateOnEnter",
	    "blur .edit"             : "close",
	    "click .inner-item"        : "updateDetail",
	    "dblclick .inner-item"     : "open"
	 },
     
     initialize : function() {
 		 var self = this;
 		 self.constructor.__super__.initialize.apply(self);
         self.model.on('change', self.render, self);
     },
     
     render: function(){
        var self = this;
        self.model.set({
            uiUpdateTime: self.getLocaleDate(self.model.get('updateTime')),
            uiSize: self.getSize(self.model.get('size'))
        }, {silent: true});
        var jsonObj = self.model.toJSON();
	    if(self.model.get("dataBagId")){
            jsonObj.processCommon = false;
		    self.processDatabag(self.model.get("dataBagId") , self.model.get("extension"), jsonObj, self.template);
		}else{
	        jsonObj.processCommon = true;
	        self.$el.html( Mustache.to_html(self.template, jsonObj));
	    }
        self.input = self.$('.edit');
		return self;
	 }
 });
